package me.ereach.multi;

public class Main02ThreadPause1 {
    public static void main(String[] args) {
        for (int i = 0; i < 5; i ++) {
            Thread thread = new Thread(() -> {
                System.out.println(Thread.currentThread().getName() + " started");
                try {
                    Thread.sleep(3000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println(Thread.currentThread().getName() + " finished");
            });

            thread.start();
        }

        System.out.println("All threads are finished.");
    }
}
